-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move all job PROPERTIES to Jenkins Files for Build and Pipeline jobs #2138
Move all job PROPERTIES to Jenkins Files for Build and Pipeline jobs #2138
Conversation
c2c5786
to
c8dfa6d
Compare
c8dfa6d
to
238eb65
Compare
// Keep last 50 of each PullRequest build | ||
NUM_BUILDS = 50 | ||
} | ||
properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: NUM_ARTIFACTS, daysToKeepStr: DAYS_BUILDS, numToKeepStr: NUM_BUILDS))]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing strategy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks not to be mandatory
// Keep last 50 of each PullRequest build | ||
NUM_BUILDS = 50 | ||
} | ||
properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: NUM_ARTIFACTS, daysToKeepStr: DAYS_BUILDS, numToKeepStr: NUM_BUILDS))]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you move this code into a fuction in variables-functions then you avoid duplicating the code.
jenkins compile win jdk10 |
@@ -20,6 +20,16 @@ | |||
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception | |||
*******************************************************************************/ | |||
|
|||
// Discard old builds | |||
NUM_ARTIFACTS = 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move NUM_ARTIFACTS, NUM_BUILDS , DAYS_BUILDS
to variables file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reformat to use variable files
jenkins compile win jdk10 |
1 similar comment
jenkins compile win jdk10 |
238eb65
to
5651298
Compare
jenkins compile win jdk10 |
3 similar comments
jenkins compile win jdk10 |
jenkins compile win jdk10 |
jenkins compile win jdk10 |
Unfortunately having the This issue comment and the next 3 comments sum it up nicely. See pipeline-syntax We might be able to define everything in the jenkinsfiles. We would have to have all the parameters and all the trigger regexes and the user whitelist in the variable file, which is a good thing. Upon initial setup you could leave all the config blank, and we could have an I will change this PR to WIP and update the title to reflect the larger task. |
7baa8d7
to
ed3aa83
Compare
Jenkins copyright check |
051c4ab
to
a1511a0
Compare
/* OPENJDK_REPO, OPENJDK_BRANCH, OPENJDK_SHA, | ||
* OPENJ9_REPO, OPENJ9_BRANCH, OPENJ9_SHA, | ||
* OMR_REPO, OMR_BRANCH, OMR_SHA, | ||
* VARIABLE_FILE, VENDOR_REPO, VENDOR_BRANCH, VENDOR_CREDENTIALS_ID */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could use a for loop
|
||
// If SDK_VERSION parameter is already set, assume it is correct (helps with Sandbox builds) | ||
// Else parse the JOB_NAME to determine the verison | ||
if (params.SDK_VERSION) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace if-else with if statement:
SDK_VERSION = params.SDK_VERSION
if (!SDK_VERSION) {
//infer from job name
...
}
} | ||
echo "SDK_VERSION:'${SDK_VERSION}'" | ||
|
||
if (params.PLATFORM) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace if-else with if statement only
PLATFORM = params.PLATFORM
if (!PLATFORM) { ... }
VENDOR_REPO = params.VENDOR_REPO | ||
VENDOR_CREDENTIALS_ID = params.VENDOR_CREDENTIALS_ID | ||
if (VARIABLE_FILE && VENDOR_REPO && VENDOR_BRANCH) { | ||
echo "VARIABLE_FILE:'${VARIABLE_FILE}'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single quotes not needed in echo
statements
echo "VENDOR_REPO:'${VENDOR_REPO}'" | ||
echo "VENDOR_BRANCH:'${VENDOR_BRANCH}'" | ||
echo "VENDOR_CREDENTIALS_ID:'${VENDOR_CREDENTIALS_ID}'" | ||
if (VENDOR_CREDENTIALS_ID != '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (VENDOR_CREDENTIALS_ID != '')
replace with if (VENDOR_CREDENTIALS_ID)
// PLEASE NOTE: The following 4 DEFAULT variables must be configured in the Jenkins Global Config (even if they are set to blank). | ||
// This allows us to know what the default values are without being told explicitly. | ||
// These DEFAULT values are typically constant per Jenkins Server. | ||
PARAMETERS.add(string(name: 'VARIABLE_FILE', defaultValue: "${VARIABLE_FILE_DEFAULT}", description: '', trim: true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add checks for the *_DEFAULT variables, e.g
if (VARIABLE_FILE_DEFAULT) {
PARAMETERS.add(string(name: 'VARIABLE_FILE', defaultValue: "${VARIABLE_FILE_DEFAULT}", description: '', trim: true))
}
e0b99a5
to
8fafa7b
Compare
@smlambert for final review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than minor typo, LGTM
if (JOB_TYPE == "build" || JOB_TYPE == "pipeline") { | ||
// Start with just supporting Build and Pipeline jobs | ||
// PR jobs will need some playing to get the trigger figured out | ||
// Also regaring PR builds, see OpenJ9 Issue #2728 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spelling regaring -> regarding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
- Add Build Discarder - Retrieve values from Variable file - Add job Parameters - Default values for Vendor Params must be set globally even if they are blank - No Trigger for Build and Pipeline jobs - TODO add trigger for PR builds Issue eclipse-openj9#1017 [skip ci] Signed-off-by: Adam Brousseau <adam.brousseau88@gmail.com>
8fafa7b
to
2d3379d
Compare
- Using params.PARAM will allow null to be passed to a downstream job. This causes a failure if the downstream job has the parameter configured. - Null value not allowed as an environment variable - Adding a check and setting the variable to blank should resolve this failure [skip ci] Issue eclipse-openj9#2138 Signed-off-by: Adam Brousseau <adam.brousseau88@gmail.com>
- Add BUILD_NODE, TEST_NODE, PERSONAL_BUILD and SLACK_CHANNEL - Missed in original PR eclipse-openj9#2138 [skip ci] Signed-off-by: Adam Brousseau <adam.brousseau88@gmail.com>
even if they are blank
[skip ci]
Issue #1017
Signed-off-by: Adam Brousseau adam.brousseau88@gmail.com
Depends
#2093